package com.muyu.payment.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.muyu.common.core.web.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 余额变动记录实体类
 *
 * @author muyu
 * @date 2025-01-27
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("balance_transaction")
@Schema(description = "余额变动记录")
public class BalanceTransaction extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    /**
     * 交易流水号
     */
    @Schema(description = "交易流水号")
    private String transactionNo;

    /**
     * 用户ID
     */
    @Schema(description = "用户ID")
    private Long userId;

    /**
     * 用户账号
     */
    @Schema(description = "用户账号")
    private String userName;

    /**
     * 交易类型（1:充值 2:提现 3:消费 4:退款 5:冻结 6:解冻）
     */
    @Schema(description = "交易类型（1:充值 2:提现 3:消费 4:退款 5:冻结 6:解冻）")
    private Integer transactionType;

    /**
     * 交易金额
     */
    @Schema(description = "交易金额")
    private BigDecimal amount;

    /**
     * 交易前余额
     */
    @Schema(description = "交易前余额")
    private BigDecimal beforeBalance;

    /**
     * 交易后余额
     */
    @Schema(description = "交易后余额")
    private BigDecimal afterBalance;

    /**
     * 关联订单号
     */
    @Schema(description = "关联订单号")
    private String orderNo;

    /**
     * 交易状态（0:处理中 1:成功 2:失败）
     */
    @Schema(description = "交易状态（0:处理中 1:成功 2:失败）")
    private Integer status;

    /**
     * 交易描述
     */
    @Schema(description = "交易描述")
    private String description;

    /**
     * 第三方交易号
     */
    @Schema(description = "第三方交易号")
    private String thirdPartyTradeNo;

    /**
     * 交易时间
     */
    @Schema(description = "交易时间")
    private Date transactionTime;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;
}